package com.sleep.satokendemo.config;

import cn.dev33.satoken.stp.StpInterface;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

/**
 * @ClassName StpInterfaceImpl
 * @Description TODO 自定义的权限鉴定接口
 * @Author 郭敖
 * @Date 2024年03月31日 19:28
 * @Version 1.0
 */
@Component
@Slf4j
public class StpInterfaceImpl implements StpInterface {
    @Override
    public List<String> getPermissionList(Object o, String s) {
        List<String> list = Arrays.asList("user:add", "user:update", "user:delete");
        log.warn("Object:  {}",o);
        log.warn("String:  {}",s);
        return list;
    }

    @Override
    public List<String> getRoleList(Object o, String s) {
        return Arrays.asList("admin");
    }
}
